{% extends "expdev/base.html" %}
{% block content %}

<script type="text/javascript">
function reloaddoc(x)
{
  var y=document.getElementById(x).value;
  window.location.assign('{% url ktit.expdev.views.device_list %}' + '?par=' + y);
}
</script>

<h3 class="tfloat">Оборудование</h3>
<div id="statusselect">
<select id="status_select" onchange="reloaddoc(this.id)">
<option value="all" {% ifequal filter_loc 'all' %}selected="selected"{% endifequal %}>Все</option>
<option value="str" {% ifequal filter_loc 'str' %}selected="selected"{% endifequal %}>Склад</option>
<option value="rpr" {% ifequal filter_loc 'rpr' %}selected="selected"{% endifequal %}>Ремонт</option>
<option value="exp" {% ifequal filter_loc 'exp' %}selected="selected"{% endifequal %}>Экспозиция</option>
<option value="exh" {% ifequal filter_loc 'exh' %}selected="selected"{% endifequal %}>Выставка</option>

</select></div>

  {% if devices %}
  <table width="100%" cellpadding="2" cellspacing="1">
  <tr bgcolor="#f7f7e7">
  <th width="5%" align="center">#</th>
  <th width="20%">Наименование</th>
  <th width="10%">Серийник</th>
  <th width="15%">Инвентарник</th>
  <th width="20%">Состояние</th>
  <th width="30%">Выставка</th>
  </tr>
  {% for device in devices %}
    <tr>
      <td align="center">{{ device.id }}</td>
      <td><a href="{% url ktit.expdev.views.device_property device.id %}">{{ device.equipment.name }}</a></td>
      <td>{{ device.serial_number }}</td>
      <td>{{ device.inv_number }}</td>
      <td>{{ device.verbose_location }}</td>
      <td>{% if device.exhibition %}{{ device.exhibition }}{% else %}-{% endif %}</td>
     
    </tr>
  {% endfor %}
  </table>
  {% else %}
  <p>No devices avalible</p>
  {% endif %}

{% endblock %}
